<style scoped>
.expand-row {
  margin-bottom: 5px;
}
</style>
<template>
    <div>
        <Modal title="商品类型修改"  v-model="showmodal"  >
            <Form ref="ztype"  :model="params" :rules="ruleInline" :label-width="80">
                <FormItem label="商品类型" prop="name">
                    <Input v-model="params.name" placeholder="Enter something..."></Input>
                </FormItem>
            </Form>
            <div slot="footer">

                <Button  size="large" @click="cancleSubmit('ztype')">取消</Button>
                <Button type="primary" size="large" @click="save('ztype')">确认</Button>
            </div>
        </Modal>
    </div>
</template>
<script>
export default {
  name: "MerchantsDetail",
  data(){
      return {
          
        ruleInline: {
                    name: [
                        { required: true, message: '请输入商品类型', trigger: 'blur' }
                    ],
                }
      }
  },
  props: {
    params: Object,
    showmodal:Boolean,
  },
  methods: {
    cancleSubmit(name){
            this.$refs[name].resetFields();
    },    
    save(name){
         this.$refs[name].validate((valid) => {
                    if (valid) {
                        let addApply = Object.assign({},this.addApply)
                        
                        // addApply.serviceEndDate = formatDate(new Date(addApply.serviceEndDate),'yyyy-MM-dd')
                        // createApply(addApply).then(res=>{
                        //     if(res.data.errcode ===0){
                        //         this.dialogAdd = false
                        //         this.$Message.info('创建成功！')
                        //         this._getApplyList()
                        //         this.$refs[name].resetFields();
                        //     } else if(res.data.errcode === 40199){
                        //         this.$Message.error('创建失败,该书库应用已存在！')
                        //     }
                        // })
                    }
                })
    }
  },
  
  
};
</script>